package com.baijia.authentication;

import com.baijia.authentication.principal.Credentials;

/**
 * @title AuthenticationMetaDataPopulator
 * @desc 填充认证额外信息 
 * @author caoliang
 * @date 2015年12月5日
 * @version 1.0
 */
public interface AuthenticationMetaDataPopulator {
    
    static final String ACCOUNT_ID = "accountId";
    static final String ACCOUNT_NUMBER = "accountNumber";
    static final String ACCOUNT_MOBILE = "accountMobile";

    public static final String PASSPORT_ID = "passportId";
    public static final String ORG_ACCOUNT = "orgAccount";
    public static final String ORG_CASCADE_ACCOUNTID = "orgCascadeAccountId";
    public static final String ORG_CASCADE_ACCOUNT = "orgCascadeAccount";
    public static final String USER = "user";
//    public static final String USER_ID = "userId";
//    public static final String ORG_ID = "org_id";
//    public static final String MOBILE = "mobile";


    /**
     * 通过credentials，向authentication填充额外的信息
     * 
     * @param 认证成功后返回的信息
     * @return 补充信息后的authentication
     */
    Authentication populateAttributes(Authentication authentication,
        Credentials credentials);
    
    boolean supports(Credentials credentials);
    
}
